package org.chs.ts.base.common.util;

import org.chs.ts.base.constant.CommonConstant;

/**
 * @author wuwei
 * @date 2024/11/30
 * @apiNote
 */
public class oConvertUtils {
    public static String getString(String str) {

        return getString(str,"");

    }

    public static String getString(String str,String defval){
        if(isEmpty(str)){
            return defval;
        }
        return str.trim();
    }

    private static boolean isEmpty(Object obj) {
        if (obj == null) {
            return true;
        }
        if ("".equals(obj)) {
            return true;
        }
        return CommonConstant.STRING_NULL.equals(obj);
    }
}
